# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=jpegexiforient
epoch=1
pkgver=20090111.b4f886f
pkgrel=1
pkgdesc='Get and set the Exif Orientation Tag'
url='https://github.com/freedesktop/libjpeg'
license=('custom')
arch=('x86_64')
makedepends=('git')
depends=('libjpeg-turbo')
_commit=b4f886fcbb692e20fb4da4e6e3ead57f79444734
source=("git+https://github.com/freedesktop/libjpeg#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/libjpeg"
	git log -1 --format='%cd.%h' --date=short | tr -d -
}

build() {
	cd "${srcdir}/libjpeg/extra"
	make
}

package() {
	cd "${srcdir}/libjpeg/extra"
	install -d "${pkgdir}/usr/"{bin,share/man/man1}
	make prefix=/usr DESTDIR="${pkgdir}" install
	install -Dm644 /usr/share/licenses/libjpeg-turbo/LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
